package cn.stylefeng.guns.modular.business.frequency.cmcity.mapper;

import cn.stylefeng.guns.modular.business.frequency.cmarea.entity.CmArea;
import cn.stylefeng.guns.modular.business.frequency.cmcity.model.result.TreeNodeCity;
import cn.stylefeng.guns.modular.business.frequency.cmprovince.entity.CmProvince;
import cn.stylefeng.guns.modular.business.frequency.cmprovince.model.param.AdministrativeDivisionDTO;
import cn.stylefeng.guns.modular.business.frequency.cmprovince.model.result.PkgCmCity;
import cn.stylefeng.guns.modular.business.frequency.cmprovince.model.result.PkgProvince;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import cn.stylefeng.guns.modular.business.frequency.cmcity.entity.CmCity;
import com.tencentcloudapi.ecm.v20190719.models.Province;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * cm_city Mapper 接口
 *
 * @author yujie
 * @date 2023/05/09 17:17
 */
public interface CmCityMapper extends BaseMapper<CmCity> {

    List<PkgCmCity> getAllCityList(@Param("administrativeDivisionDTO") AdministrativeDivisionDTO administrativeDivisionDTO);

    List<CmArea> getAreaListByCityCode(@Param("cityCode") String cityCode);

    List<CmCity> getNonCountyCityByProvinceCode(@Param("provinceCode") String provinceCode);

    int countByCode(@Param("isUpdate") boolean isUpdate, @Param("code") String code);


    String getProvinceNameByProvinceCode(@Param("provinceCode") String provinceCode);


    String getNameByCode(@Param("code") String cityCode);

    void deleteCity(@Param("code") String code);

    CmCity getCityByCode(@Param("code") String code);

    List<CmProvince> getProvinceList();

    List<PkgProvince> getPkgProvinceCity();

    String getCodeByName(String startCode);
    List<TreeNodeCity> getTreeProvinceCity( );

    @MapKey("code")
    Map<String, CmCity> getAllCityMap();
}